package com.um.jdy.platform.base.controller;


import com.um.jdy.platform.base.entity.dto.AddressParam;
import com.um.jdy.platform.base.manager.AreaManager;
import com.um.springboot.starter.annotation.TokenRequired;
import com.um.springboot.starter.orm.controller.BaseController;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;


/**
 * 控制器：地区表
 */
@RestController
@RequestMapping("/api/v1/cms/base/area")
@Api(tags = "AreaController", description = "地区表")
@TokenRequired
public class AreaController extends BaseController<AreaManager> {


    @ApiOperation("省市区树结构")
    @GetMapping("tree")
    public Response getAreaTree(){
       return manager.getAreaTree();
    }

    /**
     * 搜索地址
     *
     * @param param
     * @return
     */
    @PostMapping("search_address")
    public Response searchAddress(@RequestBody AddressParam param) {
        return manager.searchAddress(param);
    }

//    /**
//     * 逆地址解析
//     * @param param
//     * @return
//     */
//    @PostMapping("inverse_geocode")
//    public Response inverseGeocode(@RequestBody AddressParam param) {
//        return manager.inverseGeocode(param);
//    }

    /**
     * 获取定位
     * @return
     */
//    @PostMapping("get_location")
//    public Response getLocation() {
//        return manager.getLocation();
//    }
}
